<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery-3.3.1.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" src="js/code.js"></script>
<link href="css/bootstrap.css"  rel="stylesheet" type="text/css">
<link href="css/bootstrapValidator.min.css"  rel="stylesheet" >
<script src="js/bootstrapValidator.js"></script>
</head>
<body>
<h1 align="center">欢迎登录办公自动化系统</h1>
	<br><br>
	
		<div class="col-md-12 text-right">
							
		<div class="modal-body" style="width: 600px; margin-left: 470px;">
					<div style="width: 480px;padding-left: 20px ; display: none; " align="center" id="imageselect">
						
						
						<button class="btn btn-primary" id="closeselecticon">关闭</button>
					</div> 
					<br><br><br>
                <form id="loginform" class="required-validate" action="${pageContext.request.contextPath }tologin"
						method="post">
                
                    <div class="form-group">
                        <label for="loginname" class="control-label">用户名:</label>
                        <input type="text" class="form-control" id="loginname" name="loginname">
                    </div>
                  
                    <div class="form-group">
                        <label for="loginpw" class="control-label">密码:</label>
                        <input type="password" class="form-control" id="loginpw" name="loginpw">
                    </div>
                  
                    
                    <!-- <div class="form-group">
                    	<label for="incode" class="control-label">验证码:<img id="img"  alt="" src="code.jsp" ><a>看不清</a></label>
                    	<input type="text" class="form-control" id="incode" name="incode">
                    </div> -->
                    	
                    
                </form>
                	<div  align="center">
                        <span id="returnMessage" class="glyphicon"> </span>
                       <button type="button" class="btn btn-primary"
						onclick="logintomain()">登录</button>
						
						<a href="toregister"><i class="btn btn-primary">注册</i></a>
						<a href="toGuanLi"><i class="btn btn-primary">管理员登录</i></a>
                    </div>
                	
            </div>
            
            
            
            
            
</body>

<script language="JavaScript">
function logintomain(){
	
	$.post("<%=basePath%>/login.action",$("#loginform").serialize(),function(data){
		

	    
		alert("登录成功！");
		location.href="Main";
		
		
	});
	
	
	
}








</script>
</html>